; generated by Component: ARM Compiler 5.06 update 4 (build 422) Tool: ArmCC [4d3604]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o..\out\plc_timer.o --asm_dir=.\Lst\ --list_dir=.\Lst\ --depend=..\out\plc_timer.d --cpu=Cortex-M3 --apcs=interwork -O0 --diag_suppress=9931 -I..\Libraries\inc -I..\CMSIS -I..\users -I..\Libraries\src -I..\Libraries\sys -I..\COMM -I..\MOD -I..\CAN -D__MICROLIB -D__UVISION_VERSION=523 -D_RTE_ -DSTM32F10X_HD -DSTM32F10X_HD -DUSE_STDPERIPH_DRIVER --omf_browse=..\out\plc_timer.crf ..\users\PLC_timer.c]
                          THUMB

                          AREA ||i.Delay||, CODE, READONLY, ALIGN=1

                  Delay PROC
;;;32     *******************************************************************************/
;;;33     void Delay(u16 time)
000000  2100              MOVS     r1,#0
;;;34     {    
;;;35        u16 i=0;  
;;;36        while(time--)
000002  e007              B        |L1.20|
                  |L1.4|
;;;37        {
;;;38     	   i=12000; 
000004  f64261e0          MOV      r1,#0x2ee0
;;;39     		 while(i--); 
000008  bf00              NOP      
                  |L1.10|
00000a  1e0a              SUBS     r2,r1,#0
00000c  f1a10301          SUB      r3,r1,#1
000010  b299              UXTH     r1,r3
000012  d1fa              BNE      |L1.10|
                  |L1.20|
000014  1e02              SUBS     r2,r0,#0              ;36
000016  f1a00301          SUB      r3,r0,#1              ;36
00001a  b298              UXTH     r0,r3                 ;36
00001c  d1f2              BNE      |L1.4|
;;;40     	 }
;;;41     }
00001e  4770              BX       lr
;;;42     
                          ENDP


                          AREA ||i.T_100MS||, CODE, READONLY, ALIGN=2

                  T_100MS PROC
;;;92     static volatile u16 *pT_100msSetValue,*pT_100msCurrentValue;
;;;93     void T_100MS(void)
000000  b570              PUSH     {r4-r6,lr}
;;;94     {
;;;95     	u16 timer_count;
;;;96       for(timer_count =0;timer_count<200;timer_count++)
000002  2000              MOVS     r0,#0
000004  e044              B        |L2.144|
                  |L2.6|
;;;97     	{ 
;;;98     		  pT_100msSetValue = plc_16BitBuf + 0x0900 + timer_count;
000006  4924              LDR      r1,|L2.152|
000008  eb010140          ADD      r1,r1,r0,LSL #1
00000c  4a23              LDR      r2,|L2.156|
00000e  6011              STR      r1,[r2,#0]  ; pT_100msSetValue
;;;99     	    pT_100msCurrentValue =plc_16BitBuf + 0x0800 + timer_count;
000010  4923              LDR      r1,|L2.160|
000012  eb010140          ADD      r1,r1,r0,LSL #1
000016  4a23              LDR      r2,|L2.164|
000018  6011              STR      r1,[r2,#0]  ; pT_100msCurrentValue
;;;100    	    if(PLC_BIT_TEST(0x1600 + timer_count)) //Ȧ״̬
00001a  f50052b0          ADD      r2,r0,#0x1600
00001e  17d3              ASRS     r3,r2,#31
000020  eb027353          ADD      r3,r2,r3,LSR #29
000024  4c20              LDR      r4,|L2.168|
000026  eb0403e3          ADD      r3,r4,r3,ASR #3
00002a  781b              LDRB     r3,[r3,#0]
00002c  4611              MOV      r1,r2
00002e  17cc              ASRS     r4,r1,#31
000030  eb017454          ADD      r4,r1,r4,LSR #29
000034  10e4              ASRS     r4,r4,#3
000036  eba104c4          SUB      r4,r1,r4,LSL #3
00003a  4d1c              LDR      r5,|L2.172|
00003c  5d2c              LDRB     r4,[r5,r4]
00003e  4023              ANDS     r3,r3,r4
000040  b323              CBZ      r3,|L2.140|
;;;101    		  {
;;;102    			  if( (*pT_100msCurrentValue) < (*pT_100msSetValue) ) //ֵ״̬
000042  4918              LDR      r1,|L2.164|
000044  6809              LDR      r1,[r1,#0]  ; pT_100msCurrentValue
000046  8809              LDRH     r1,[r1,#0]
000048  4a14              LDR      r2,|L2.156|
00004a  6812              LDR      r2,[r2,#0]  ; pT_100msSetValue
00004c  8812              LDRH     r2,[r2,#0]
00004e  4291              CMP      r1,r2
000050  da1c              BGE      |L2.140|
;;;103    				{
;;;104    					 u16 ret = PLC_BIT_TEST(0x600 + timer_count);
000052  f50062c0          ADD      r2,r0,#0x600
000056  17d4              ASRS     r4,r2,#31
000058  eb027454          ADD      r4,r2,r4,LSR #29
00005c  4d12              LDR      r5,|L2.168|
00005e  eb0504e4          ADD      r4,r5,r4,ASR #3
000062  7824              LDRB     r4,[r4,#0]
000064  4611              MOV      r1,r2
000066  17cd              ASRS     r5,r1,#31
000068  eb017555          ADD      r5,r1,r5,LSR #29
00006c  10ed              ASRS     r5,r5,#3
00006e  eba105c5          SUB      r5,r1,r5,LSL #3
000072  4e0e              LDR      r6,|L2.172|
000074  5d75              LDRB     r5,[r6,r5]
000076  ea040305          AND      r3,r4,r5
;;;105    				  if(!ret) 
00007a  b933              CBNZ     r3,|L2.138|
;;;106    						*pT_100msCurrentValue +=1; // ʱ
00007c  4909              LDR      r1,|L2.164|
00007e  6809              LDR      r1,[r1,#0]  ; pT_100msCurrentValue
000080  8809              LDRH     r1,[r1,#0]
000082  1c49              ADDS     r1,r1,#1
000084  4a07              LDR      r2,|L2.164|
000086  6812              LDR      r2,[r2,#0]  ; pT_100msCurrentValue
000088  8011              STRH     r1,[r2,#0]
                  |L2.138|
;;;107    				}
00008a  bf00              NOP      
                  |L2.140|
00008c  1c41              ADDS     r1,r0,#1              ;96
00008e  b288              UXTH     r0,r1                 ;96
                  |L2.144|
000090  28c8              CMP      r0,#0xc8              ;96
000092  dbb8              BLT      |L2.6|
;;;108    		  }
;;;109    	 }
;;;110    }
000094  bd70              POP      {r4-r6,pc}
;;;111    
                          ENDP

000096  0000              DCW      0x0000
                  |L2.152|
                          DCD      plc_16BitBuf+0x1200
                  |L2.156|
                          DCD      pT_100msSetValue
                  |L2.160|
                          DCD      plc_16BitBuf+0x1000
                  |L2.164|
                          DCD      pT_100msCurrentValue
                  |L2.168|
                          DCD      0x20001000
                  |L2.172|
                          DCD      PLC_BIT_OR

                          AREA ||i.T_10MS||, CODE, READONLY, ALIGN=2

                  T_10MS PROC
;;;113    static volatile u16 *pT_10msSetValue,*pT_10msCurrentValue;
;;;114    void T_10MS(void)
000000  b530              PUSH     {r4,r5,lr}
;;;115    {  
;;;116       u16 timer_count;
;;;117       for(timer_count =200;timer_count<246;timer_count++)
000002  20c8              MOVS     r0,#0xc8
000004  e041              B        |L3.138|
                  |L3.6|
;;;118       { 
;;;119    		  pT_10msSetValue=plc_16BitBuf + 0x0900 + timer_count;
000006  4922              LDR      r1,|L3.144|
000008  eb010140          ADD      r1,r1,r0,LSL #1
00000c  4a21              LDR      r2,|L3.148|
00000e  6011              STR      r1,[r2,#0]  ; pT_10msSetValue
;;;120    	    pT_10msCurrentValue=plc_16BitBuf + 0x0800 + timer_count;
000010  4921              LDR      r1,|L3.152|
000012  eb010140          ADD      r1,r1,r0,LSL #1
000016  4a21              LDR      r2,|L3.156|
000018  6011              STR      r1,[r2,#0]  ; pT_10msCurrentValue
;;;121    	    if(PLC_BIT_TEST(0x1600 + timer_count)) //Ȧ״̬
00001a  f50052b0          ADD      r2,r0,#0x1600
00001e  17d3              ASRS     r3,r2,#31
000020  eb027353          ADD      r3,r2,r3,LSR #29
000024  4c1e              LDR      r4,|L3.160|
000026  eb0403e3          ADD      r3,r4,r3,ASR #3
00002a  781b              LDRB     r3,[r3,#0]
00002c  4611              MOV      r1,r2
00002e  17cc              ASRS     r4,r1,#31
000030  eb017454          ADD      r4,r1,r4,LSR #29
000034  10e4              ASRS     r4,r4,#3
000036  eba104c4          SUB      r4,r1,r4,LSL #3
00003a  4d1a              LDR      r5,|L3.164|
00003c  5d2c              LDRB     r4,[r5,r4]
00003e  4023              ANDS     r3,r3,r4
000040  b30b              CBZ      r3,|L3.134|
;;;122    		  {
;;;123              if(*pT_10msCurrentValue<*pT_10msSetValue) //ֵ״̬
000042  4916              LDR      r1,|L3.156|
000044  6809              LDR      r1,[r1,#0]  ; pT_10msCurrentValue
000046  8809              LDRH     r1,[r1,#0]
000048  4a12              LDR      r2,|L3.148|
00004a  6812              LDR      r2,[r2,#0]  ; pT_10msSetValue
00004c  8812              LDRH     r2,[r2,#0]
00004e  4291              CMP      r1,r2
000050  da19              BGE      |L3.134|
;;;124    				  {
;;;125    				     if(PLC_BIT_TEST(0x600 + timer_count)) ;
000052  f50062c0          ADD      r2,r0,#0x600
000056  17d3              ASRS     r3,r2,#31
000058  eb027353          ADD      r3,r2,r3,LSR #29
00005c  4c10              LDR      r4,|L3.160|
00005e  eb0403e3          ADD      r3,r4,r3,ASR #3
000062  781b              LDRB     r3,[r3,#0]
000064  4611              MOV      r1,r2
000066  17cc              ASRS     r4,r1,#31
000068  eb017454          ADD      r4,r1,r4,LSR #29
00006c  10e4              ASRS     r4,r4,#3
00006e  eba104c4          SUB      r4,r1,r4,LSL #3
000072  5d2c              LDRB     r4,[r5,r4]
000074  4023              ANDS     r3,r3,r4
000076  b933              CBNZ     r3,|L3.134|
;;;126    				     else 
;;;127    							 *pT_10msCurrentValue +=1;
000078  4908              LDR      r1,|L3.156|
00007a  6809              LDR      r1,[r1,#0]  ; pT_10msCurrentValue
00007c  8809              LDRH     r1,[r1,#0]
00007e  1c49              ADDS     r1,r1,#1
000080  4a06              LDR      r2,|L3.156|
000082  6812              LDR      r2,[r2,#0]  ; pT_10msCurrentValue
000084  8011              STRH     r1,[r2,#0]
                  |L3.134|
000086  1c41              ADDS     r1,r0,#1              ;117
000088  b288              UXTH     r0,r1                 ;117
                  |L3.138|
00008a  28f6              CMP      r0,#0xf6              ;117
00008c  dbbb              BLT      |L3.6|
;;;128    				  }
;;;129    		  }
;;;130       }
;;;131    }
00008e  bd30              POP      {r4,r5,pc}
;;;132    
                          ENDP

                  |L3.144|
                          DCD      plc_16BitBuf+0x1200
                  |L3.148|
                          DCD      pT_10msSetValue
                  |L3.152|
                          DCD      plc_16BitBuf+0x1000
                  |L3.156|
                          DCD      pT_10msCurrentValue
                  |L3.160|
                          DCD      0x20001000
                  |L3.164|
                          DCD      PLC_BIT_OR

                          AREA ||i.T_1MS||, CODE, READONLY, ALIGN=2

                  T_1MS PROC
;;;135    static volatile u16 *pT_1msSetValue,*pT_1msCurrentValue;
;;;136    void T_1MS(void)
000000  b530              PUSH     {r4,r5,lr}
;;;137    { 
;;;138    	 u16 timer_count;  
;;;139         for(timer_count =246;timer_count<250;timer_count++)
000002  20f6              MOVS     r0,#0xf6
000004  e041              B        |L4.138|
                  |L4.6|
;;;140    	   { 
;;;141    		    pT_1msSetValue =plc_16BitBuf + 0x0900 + timer_count;
000006  4922              LDR      r1,|L4.144|
000008  eb010140          ADD      r1,r1,r0,LSL #1
00000c  4a21              LDR      r2,|L4.148|
00000e  6011              STR      r1,[r2,#0]  ; pT_1msSetValue
;;;142    	      pT_1msCurrentValue =plc_16BitBuf + 0x0800 + timer_count;
000010  4921              LDR      r1,|L4.152|
000012  eb010140          ADD      r1,r1,r0,LSL #1
000016  4a21              LDR      r2,|L4.156|
000018  6011              STR      r1,[r2,#0]  ; pT_1msCurrentValue
;;;143    	      if(PLC_BIT_TEST(0x1600 + timer_count))//Ȧ״̬
00001a  f50052b0          ADD      r2,r0,#0x1600
00001e  17d3              ASRS     r3,r2,#31
000020  eb027353          ADD      r3,r2,r3,LSR #29
000024  4c1e              LDR      r4,|L4.160|
000026  eb0403e3          ADD      r3,r4,r3,ASR #3
00002a  781b              LDRB     r3,[r3,#0]
00002c  4611              MOV      r1,r2
00002e  17cc              ASRS     r4,r1,#31
000030  eb017454          ADD      r4,r1,r4,LSR #29
000034  10e4              ASRS     r4,r4,#3
000036  eba104c4          SUB      r4,r1,r4,LSL #3
00003a  4d1a              LDR      r5,|L4.164|
00003c  5d2c              LDRB     r4,[r5,r4]
00003e  4023              ANDS     r3,r3,r4
000040  b30b              CBZ      r3,|L4.134|
;;;144    		    {  
;;;145               if(*pT_1msCurrentValue<*pT_1msSetValue) //ֵ״̬
000042  4916              LDR      r1,|L4.156|
000044  6809              LDR      r1,[r1,#0]  ; pT_1msCurrentValue
000046  8809              LDRH     r1,[r1,#0]
000048  4a12              LDR      r2,|L4.148|
00004a  6812              LDR      r2,[r2,#0]  ; pT_1msSetValue
00004c  8812              LDRH     r2,[r2,#0]
00004e  4291              CMP      r1,r2
000050  da19              BGE      |L4.134|
;;;146    				   {
;;;147    				     if(PLC_BIT_TEST(0x600 + timer_count)) ;
000052  f50062c0          ADD      r2,r0,#0x600
000056  17d3              ASRS     r3,r2,#31
000058  eb027353          ADD      r3,r2,r3,LSR #29
00005c  4c10              LDR      r4,|L4.160|
00005e  eb0403e3          ADD      r3,r4,r3,ASR #3
000062  781b              LDRB     r3,[r3,#0]
000064  4611              MOV      r1,r2
000066  17cc              ASRS     r4,r1,#31
000068  eb017454          ADD      r4,r1,r4,LSR #29
00006c  10e4              ASRS     r4,r4,#3
00006e  eba104c4          SUB      r4,r1,r4,LSL #3
000072  5d2c              LDRB     r4,[r5,r4]
000074  4023              ANDS     r3,r3,r4
000076  b933              CBNZ     r3,|L4.134|
;;;148    				     else 
;;;149    							 *pT_1msCurrentValue +=1;
000078  4908              LDR      r1,|L4.156|
00007a  6809              LDR      r1,[r1,#0]  ; pT_1msCurrentValue
00007c  8809              LDRH     r1,[r1,#0]
00007e  1c49              ADDS     r1,r1,#1
000080  4a06              LDR      r2,|L4.156|
000082  6812              LDR      r2,[r2,#0]  ; pT_1msCurrentValue
000084  8011              STRH     r1,[r2,#0]
                  |L4.134|
000086  1c41              ADDS     r1,r0,#1              ;139
000088  b288              UXTH     r0,r1                 ;139
                  |L4.138|
00008a  28fa              CMP      r0,#0xfa              ;139
00008c  dbbb              BLT      |L4.6|
;;;150    				  }
;;;151    		    }		
;;;152    	  }	
;;;153    	  
;;;154    }
00008e  bd30              POP      {r4,r5,pc}
;;;155    
                          ENDP

                  |L4.144|
                          DCD      plc_16BitBuf+0x1200
                  |L4.148|
                          DCD      pT_1msSetValue
                  |L4.152|
                          DCD      plc_16BitBuf+0x1000
                  |L4.156|
                          DCD      pT_1msCurrentValue
                  |L4.160|
                          DCD      0x20001000
                  |L4.164|
                          DCD      PLC_BIT_OR

                          AREA ||i.T_H100MS||, CODE, READONLY, ALIGN=2

                  T_H100MS PROC
;;;157    static volatile u16 *pHT_100msSetValue,*pHT_100msCurrentValue;
;;;158    void T_H100MS(void)
000000  b530              PUSH     {r4,r5,lr}
;;;159    { 
;;;160    	  u16 timer_count;
;;;161        for(timer_count =250;timer_count <256;timer_count++)
000002  20fa              MOVS     r0,#0xfa
000004  e041              B        |L5.138|
                  |L5.6|
;;;162    	  { 
;;;163    		   pHT_100msSetValue =plc_16BitBuf+0x0900+timer_count;
000006  4922              LDR      r1,|L5.144|
000008  eb010140          ADD      r1,r1,r0,LSL #1
00000c  4a21              LDR      r2,|L5.148|
00000e  6011              STR      r1,[r2,#0]  ; pHT_100msSetValue
;;;164    	     pHT_100msCurrentValue =plc_16BitBuf+0x0800+timer_count;
000010  4921              LDR      r1,|L5.152|
000012  eb010140          ADD      r1,r1,r0,LSL #1
000016  4a21              LDR      r2,|L5.156|
000018  6011              STR      r1,[r2,#0]  ; pHT_100msCurrentValue
;;;165    	     if(PLC_BIT_TEST(0x1600 +timer_count))  // Ȧ״̬
00001a  f50052b0          ADD      r2,r0,#0x1600
00001e  17d3              ASRS     r3,r2,#31
000020  eb027353          ADD      r3,r2,r3,LSR #29
000024  4c1e              LDR      r4,|L5.160|
000026  eb0403e3          ADD      r3,r4,r3,ASR #3
00002a  781b              LDRB     r3,[r3,#0]
00002c  4611              MOV      r1,r2
00002e  17cc              ASRS     r4,r1,#31
000030  eb017454          ADD      r4,r1,r4,LSR #29
000034  10e4              ASRS     r4,r4,#3
000036  eba104c4          SUB      r4,r1,r4,LSL #3
00003a  4d1a              LDR      r5,|L5.164|
00003c  5d2c              LDRB     r4,[r5,r4]
00003e  4023              ANDS     r3,r3,r4
000040  b30b              CBZ      r3,|L5.134|
;;;166    		   {
;;;167               if(*pHT_100msCurrentValue < *pHT_100msSetValue) //ֵ״̬
000042  4916              LDR      r1,|L5.156|
000044  6809              LDR      r1,[r1,#0]  ; pHT_100msCurrentValue
000046  8809              LDRH     r1,[r1,#0]
000048  4a12              LDR      r2,|L5.148|
00004a  6812              LDR      r2,[r2,#0]  ; pHT_100msSetValue
00004c  8812              LDRH     r2,[r2,#0]
00004e  4291              CMP      r1,r2
000050  da19              BGE      |L5.134|
;;;168    				   {
;;;169    				     if(PLC_BIT_TEST(0x600 + timer_count)) ;
000052  f50062c0          ADD      r2,r0,#0x600
000056  17d3              ASRS     r3,r2,#31
000058  eb027353          ADD      r3,r2,r3,LSR #29
00005c  4c10              LDR      r4,|L5.160|
00005e  eb0403e3          ADD      r3,r4,r3,ASR #3
000062  781b              LDRB     r3,[r3,#0]
000064  4611              MOV      r1,r2
000066  17cc              ASRS     r4,r1,#31
000068  eb017454          ADD      r4,r1,r4,LSR #29
00006c  10e4              ASRS     r4,r4,#3
00006e  eba104c4          SUB      r4,r1,r4,LSL #3
000072  5d2c              LDRB     r4,[r5,r4]
000074  4023              ANDS     r3,r3,r4
000076  b933              CBNZ     r3,|L5.134|
;;;170    				     else 
;;;171    							 *pHT_100msCurrentValue +=1;
000078  4908              LDR      r1,|L5.156|
00007a  6809              LDR      r1,[r1,#0]  ; pHT_100msCurrentValue
00007c  8809              LDRH     r1,[r1,#0]
00007e  1c49              ADDS     r1,r1,#1
000080  4a06              LDR      r2,|L5.156|
000082  6812              LDR      r2,[r2,#0]  ; pHT_100msCurrentValue
000084  8011              STRH     r1,[r2,#0]
                  |L5.134|
000086  1c41              ADDS     r1,r0,#1              ;161
000088  b288              UXTH     r0,r1                 ;161
                  |L5.138|
00008a  28ff              CMP      r0,#0xff              ;161
00008c  ddbb              BLE      |L5.6|
;;;172    				   }
;;;173    		   }
;;;174    	   }
;;;175    }
00008e  bd30              POP      {r4,r5,pc}
;;;176    
                          ENDP

                  |L5.144|
                          DCD      plc_16BitBuf+0x1200
                  |L5.148|
                          DCD      pHT_100msSetValue
                  |L5.152|
                          DCD      plc_16BitBuf+0x1000
                  |L5.156|
                          DCD      pHT_100msCurrentValue
                  |L5.160|
                          DCD      0x20001000
                  |L5.164|
                          DCD      PLC_BIT_OR

                          AREA ||i.timer_disble||, CODE, READONLY, ALIGN=2

                  timer_disble PROC
;;;73     static volatile u16 *pT_DisSetValue,*pT_DisCurrentValue;	
;;;74     void timer_disble(u16 timer_number)
000000  b530              PUSH     {r4,r5,lr}
;;;75     {    
;;;76     	pT_DisSetValue =plc_16BitBuf+0x0900+timer_number;	// 趨ַ
000002  4931              LDR      r1,|L6.200|
000004  eb010140          ADD      r1,r1,r0,LSL #1
000008  4a30              LDR      r2,|L6.204|
00000a  6011              STR      r1,[r2,#0]  ; pT_DisSetValue
;;;77     	pT_DisCurrentValue =plc_16BitBuf+0x0800+timer_number;	// ǰֵַ
00000c  4930              LDR      r1,|L6.208|
00000e  eb010140          ADD      r1,r1,r0,LSL #1
000012  4a30              LDR      r2,|L6.212|
000014  6011              STR      r1,[r2,#0]  ; pT_DisCurrentValue
;;;78     	//
;;;79     	PLC_BIT_OFF(0x600+timer_number);	//Ȧ
000016  f50061c0          ADD      r1,r0,#0x600
00001a  17cb              ASRS     r3,r1,#31
00001c  eb017353          ADD      r3,r1,r3,LSR #29
000020  4c2d              LDR      r4,|L6.216|
000022  eb0403e3          ADD      r3,r4,r3,ASR #3
000026  781b              LDRB     r3,[r3,#0]
000028  460a              MOV      r2,r1
00002a  17d4              ASRS     r4,r2,#31
00002c  eb027454          ADD      r4,r2,r4,LSR #29
000030  10e4              ASRS     r4,r4,#3
000032  eba204c4          SUB      r4,r2,r4,LSL #3
000036  4d29              LDR      r5,|L6.220|
000038  5d2c              LDRB     r4,[r5,r4]
00003a  4023              ANDS     r3,r3,r4
00003c  17cc              ASRS     r4,r1,#31
00003e  eb017454          ADD      r4,r1,r4,LSR #29
000042  4d25              LDR      r5,|L6.216|
000044  eb0504e4          ADD      r4,r5,r4,ASR #3
000048  7023              STRB     r3,[r4,#0]
;;;80     	PLC_BIT_OFF(0x1600+timer_number); //ʹȦ
00004a  f50051b0          ADD      r1,r0,#0x1600
00004e  17cb              ASRS     r3,r1,#31
000050  eb017353          ADD      r3,r1,r3,LSR #29
000054  462c              MOV      r4,r5
000056  eb0403e3          ADD      r3,r4,r3,ASR #3
00005a  781b              LDRB     r3,[r3,#0]
00005c  460a              MOV      r2,r1
00005e  17d4              ASRS     r4,r2,#31
000060  eb027454          ADD      r4,r2,r4,LSR #29
000064  10e4              ASRS     r4,r4,#3
000066  eba204c4          SUB      r4,r2,r4,LSL #3
00006a  4d1c              LDR      r5,|L6.220|
00006c  5d2c              LDRB     r4,[r5,r4]
00006e  4023              ANDS     r3,r3,r4
000070  17cc              ASRS     r4,r1,#31
000072  eb017454          ADD      r4,r1,r4,LSR #29
000076  4d18              LDR      r5,|L6.216|
000078  eb0504e4          ADD      r4,r5,r4,ASR #3
00007c  7023              STRB     r3,[r4,#0]
;;;81     	PLC_BIT_OFF(0x3800+timer_number); //λȦ
00007e  f5005160          ADD      r1,r0,#0x3800
000082  17cb              ASRS     r3,r1,#31
000084  eb017353          ADD      r3,r1,r3,LSR #29
000088  462c              MOV      r4,r5
00008a  eb0403e3          ADD      r3,r4,r3,ASR #3
00008e  781b              LDRB     r3,[r3,#0]
000090  460a              MOV      r2,r1
000092  17d4              ASRS     r4,r2,#31
000094  eb027454          ADD      r4,r2,r4,LSR #29
000098  10e4              ASRS     r4,r4,#3
00009a  eba204c4          SUB      r4,r2,r4,LSL #3
00009e  4d0f              LDR      r5,|L6.220|
0000a0  5d2c              LDRB     r4,[r5,r4]
0000a2  4023              ANDS     r3,r3,r4
0000a4  17cc              ASRS     r4,r1,#31
0000a6  eb017454          ADD      r4,r1,r4,LSR #29
0000aa  4d0b              LDR      r5,|L6.216|
0000ac  eb0504e4          ADD      r4,r5,r4,ASR #3
0000b0  7023              STRB     r3,[r4,#0]
;;;82     	
;;;83     	// ˼ǣT246~T249 41ms㶨ʱT250~T255 6100ms㶨ʱ
;;;84     	if(timer_number < 246) // ǻ㶨ʱ
0000b2  28f6              CMP      r0,#0xf6
0000b4  da06              BGE      |L6.196|
;;;85     	{
;;;86     		*pT_DisSetValue=0;
0000b6  2100              MOVS     r1,#0
0000b8  4a04              LDR      r2,|L6.204|
0000ba  6812              LDR      r2,[r2,#0]  ; pT_DisSetValue
0000bc  8011              STRH     r1,[r2,#0]
;;;87     		*pT_DisCurrentValue=0;
0000be  4a05              LDR      r2,|L6.212|
0000c0  6812              LDR      r2,[r2,#0]  ; pT_DisCurrentValue
0000c2  8011              STRH     r1,[r2,#0]
                  |L6.196|
;;;88     	}
;;;89     }
0000c4  bd30              POP      {r4,r5,pc}
;;;90     
                          ENDP

0000c6  0000              DCW      0x0000
                  |L6.200|
                          DCD      plc_16BitBuf+0x1200
                  |L6.204|
                          DCD      pT_DisSetValue
                  |L6.208|
                          DCD      plc_16BitBuf+0x1000
                  |L6.212|
                          DCD      pT_DisCurrentValue
                  |L6.216|
                          DCD      0x20001000
                  |L6.220|
                          DCD      PLC_BIT_AND

                          AREA ||i.timer_enable||, CODE, READONLY, ALIGN=2

                  timer_enable PROC
;;;43     static volatile u16 *pSetValue,*pCurrentValue;	
;;;44     void timer_enable(u16 timer_number)
000000  b530              PUSH     {r4,r5,lr}
;;;45     {    
;;;46         pSetValue=plc_16BitBuf + 0x0900 + timer_number; //趨ֵַ
000002  4954              LDR      r1,|L7.340|
000004  eb010140          ADD      r1,r1,r0,LSL #1
000008  4a53              LDR      r2,|L7.344|
00000a  6011              STR      r1,[r2,#0]  ; pSetValue
;;;47     	  pCurrentValue=plc_16BitBuf+0x0800+timer_number; // ǰֵַ
00000c  4953              LDR      r1,|L7.348|
00000e  eb010140          ADD      r1,r1,r0,LSL #1
000012  4a53              LDR      r2,|L7.352|
000014  6011              STR      r1,[r2,#0]  ; pCurrentValue
;;;48     	
;;;49     		if(*pCurrentValue < *pSetValue)
000016  4611              MOV      r1,r2
000018  6809              LDR      r1,[r1,#0]  ; pCurrentValue
00001a  8809              LDRH     r1,[r1,#0]
00001c  4a4e              LDR      r2,|L7.344|
00001e  6812              LDR      r2,[r2,#0]  ; pSetValue
000020  8812              LDRH     r2,[r2,#0]
000022  4291              CMP      r1,r2
000024  da7b              BGE      |L7.286|
;;;50     		{
;;;51     			if(PLC_BIT_TEST(0x600+timer_number)) // жϴǷպ
000026  f50062c0          ADD      r2,r0,#0x600
00002a  17d3              ASRS     r3,r2,#31
00002c  eb027353          ADD      r3,r2,r3,LSR #29
000030  4c4c              LDR      r4,|L7.356|
000032  eb0403e3          ADD      r3,r4,r3,ASR #3
000036  781b              LDRB     r3,[r3,#0]
000038  4611              MOV      r1,r2
00003a  17cc              ASRS     r4,r1,#31
00003c  eb017454          ADD      r4,r1,r4,LSR #29
000040  10e4              ASRS     r4,r4,#3
000042  eba104c4          SUB      r4,r1,r4,LSL #3
000046  4d48              LDR      r5,|L7.360|
000048  5d2c              LDRB     r4,[r5,r4]
00004a  4023              ANDS     r3,r3,r4
00004c  b1cb              CBZ      r3,|L7.130|
;;;52     			{
;;;53     					PLC_BIT_ON(0x3800+timer_number); //λȦ
00004e  f5005160          ADD      r1,r0,#0x3800
000052  17cb              ASRS     r3,r1,#31
000054  eb017353          ADD      r3,r1,r3,LSR #29
000058  4c42              LDR      r4,|L7.356|
00005a  eb0403e3          ADD      r3,r4,r3,ASR #3
00005e  781b              LDRB     r3,[r3,#0]
000060  460a              MOV      r2,r1
000062  17d4              ASRS     r4,r2,#31
000064  eb027454          ADD      r4,r2,r4,LSR #29
000068  10e4              ASRS     r4,r4,#3
00006a  eba204c4          SUB      r4,r2,r4,LSL #3
00006e  5d2c              LDRB     r4,[r5,r4]
000070  4323              ORRS     r3,r3,r4
000072  17cc              ASRS     r4,r1,#31
000074  eb017454          ADD      r4,r1,r4,LSR #29
000078  4d3a              LDR      r5,|L7.356|
00007a  eb0504e4          ADD      r4,r5,r4,ASR #3
00007e  7023              STRB     r3,[r4,#0]
000080  e067              B        |L7.338|
                  |L7.130|
;;;54     			}
;;;55     		  else 
;;;56     			{
;;;57     					PLC_BIT_OFF(0x600+timer_number); //ֵС趨ֵʱOFF
000082  f50061c0          ADD      r1,r0,#0x600
000086  17cb              ASRS     r3,r1,#31
000088  eb017353          ADD      r3,r1,r3,LSR #29
00008c  4c35              LDR      r4,|L7.356|
00008e  eb0403e3          ADD      r3,r4,r3,ASR #3
000092  781b              LDRB     r3,[r3,#0]
000094  460a              MOV      r2,r1
000096  17d4              ASRS     r4,r2,#31
000098  eb027454          ADD      r4,r2,r4,LSR #29
00009c  10e4              ASRS     r4,r4,#3
00009e  eba204c4          SUB      r4,r2,r4,LSL #3
0000a2  4d32              LDR      r5,|L7.364|
0000a4  5d2c              LDRB     r4,[r5,r4]
0000a6  4023              ANDS     r3,r3,r4
0000a8  17cc              ASRS     r4,r1,#31
0000aa  eb017454          ADD      r4,r1,r4,LSR #29
0000ae  4d2d              LDR      r5,|L7.356|
0000b0  eb0504e4          ADD      r4,r5,r4,ASR #3
0000b4  7023              STRB     r3,[r4,#0]
;;;58     					if(PLC_BIT_TEST(0x3800 + timer_number)) 
0000b6  f5005260          ADD      r2,r0,#0x3800
0000ba  17d3              ASRS     r3,r2,#31
0000bc  eb027353          ADD      r3,r2,r3,LSR #29
0000c0  462c              MOV      r4,r5
0000c2  eb0403e3          ADD      r3,r4,r3,ASR #3
0000c6  781b              LDRB     r3,[r3,#0]
0000c8  4611              MOV      r1,r2
0000ca  17cc              ASRS     r4,r1,#31
0000cc  eb017454          ADD      r4,r1,r4,LSR #29
0000d0  10e4              ASRS     r4,r4,#3
0000d2  eba104c4          SUB      r4,r1,r4,LSL #3
0000d6  4d24              LDR      r5,|L7.360|
0000d8  5d2c              LDRB     r4,[r5,r4]
0000da  4023              ANDS     r3,r3,r4
0000dc  b3cb              CBZ      r3,|L7.338|
;;;59     					{
;;;60     //						 if(timer_number < 246) // ǻ㶨ʱ
;;;61     								*pCurrentValue=0;
0000de  2100              MOVS     r1,#0
0000e0  4a1f              LDR      r2,|L7.352|
0000e2  6812              LDR      r2,[r2,#0]  ; pCurrentValue
0000e4  8011              STRH     r1,[r2,#0]
;;;62     						
;;;63     						 PLC_BIT_OFF(0x3800 + timer_number);
0000e6  f5005160          ADD      r1,r0,#0x3800
0000ea  17cb              ASRS     r3,r1,#31
0000ec  eb017353          ADD      r3,r1,r3,LSR #29
0000f0  4c1c              LDR      r4,|L7.356|
0000f2  eb0403e3          ADD      r3,r4,r3,ASR #3
0000f6  781b              LDRB     r3,[r3,#0]
0000f8  460a              MOV      r2,r1
0000fa  17d4              ASRS     r4,r2,#31
0000fc  eb027454          ADD      r4,r2,r4,LSR #29
000100  10e4              ASRS     r4,r4,#3
000102  eba204c4          SUB      r4,r2,r4,LSL #3
000106  4d19              LDR      r5,|L7.364|
000108  5d2c              LDRB     r4,[r5,r4]
00010a  4023              ANDS     r3,r3,r4
00010c  17cc              ASRS     r4,r1,#31
00010e  eb017454          ADD      r4,r1,r4,LSR #29
000112  4d14              LDR      r5,|L7.356|
000114  eb0504e4          ADD      r4,r5,r4,ASR #3
000118  7023              STRB     r3,[r4,#0]
00011a  e01a              B        |L7.338|
00011c  e7ff              B        |L7.286|
                  |L7.286|
;;;64     					}
;;;65     			}
;;;66     		}
;;;67     		else
;;;68     		{
;;;69     				PLC_BIT_ON(0x600+timer_number);  //ֵ趨ֵʱON
00011e  f50061c0          ADD      r1,r0,#0x600
000122  17cb              ASRS     r3,r1,#31
000124  eb017353          ADD      r3,r1,r3,LSR #29
000128  4c0e              LDR      r4,|L7.356|
00012a  eb0403e3          ADD      r3,r4,r3,ASR #3
00012e  781b              LDRB     r3,[r3,#0]
000130  460a              MOV      r2,r1
000132  17d4              ASRS     r4,r2,#31
000134  eb027454          ADD      r4,r2,r4,LSR #29
000138  10e4              ASRS     r4,r4,#3
00013a  eba204c4          SUB      r4,r2,r4,LSL #3
00013e  4d0a              LDR      r5,|L7.360|
000140  5d2c              LDRB     r4,[r5,r4]
000142  4323              ORRS     r3,r3,r4
000144  17cc              ASRS     r4,r1,#31
000146  eb017454          ADD      r4,r1,r4,LSR #29
00014a  4d06              LDR      r5,|L7.356|
00014c  eb0504e4          ADD      r4,r5,r4,ASR #3
000150  7023              STRB     r3,[r4,#0]
                  |L7.338|
;;;70     		}
;;;71     }
000152  bd30              POP      {r4,r5,pc}
;;;72     
                          ENDP

                  |L7.340|
                          DCD      plc_16BitBuf+0x1200
                  |L7.344|
                          DCD      pSetValue
                  |L7.348|
                          DCD      plc_16BitBuf+0x1000
                  |L7.352|
                          DCD      pCurrentValue
                  |L7.356|
                          DCD      0x20001000
                  |L7.360|
                          DCD      PLC_BIT_OR
                  |L7.364|
                          DCD      PLC_BIT_AND

                          AREA ||.data||, DATA, ALIGN=2

                  pSetValue
                          DCD      0x00000000
                  pCurrentValue
                          DCD      0x00000000
                  pT_DisSetValue
                          DCD      0x00000000
                  pT_DisCurrentValue
                          DCD      0x00000000
                  pT_100msSetValue
                          DCD      0x00000000
                  pT_100msCurrentValue
                          DCD      0x00000000
                  pT_10msSetValue
                          DCD      0x00000000
                  pT_10msCurrentValue
                          DCD      0x00000000
                  pT_1msSetValue
                          DCD      0x00000000
                  pT_1msCurrentValue
                          DCD      0x00000000
                  pHT_100msSetValue
                          DCD      0x00000000
                  pHT_100msCurrentValue
                          DCD      0x00000000
